/*
Modified WOO Camera by Mondkalb (Modified by MrCash2009)

Contact me (Mondkalb) via E-Mail:
CEO@mondkalb.org
*/

disableSerialization;

_dia = createdialog "MBG_WOO_maininterface";

_display = findDisplay 5990;
_display displaySetEventHandler ["KeyDown","_this call MBG_WOO_FUNC_DetectKeys"];
_display displaySetEventHandler ["KeyUp","_this call MBG_WOO_FUNC_DisableKeys"];
_display displaySetEventHandler ["MouseMoving","_this call MBG_WOO_FUNC_RotateScreen"];

20000 cutRsc ["MBG_WOO_main_EventMessages","PLAIN",0];

MBG_WOO_Main_cam_Center_POS = (getpos player);
MBG_WOO_Main_cam_Center = "heliHempty" createvehicle MBG_WOO_Main_cam_Center_POS;
_dir = getdir MBG_WOO_Main_cam_Center;
MBG_WOO_Main_cam_View_POS = [((MBG_WOO_Main_cam_Center_POS select 0) + ((MBG_WOO_CamDist)*sin _dir)),((MBG_WOO_Main_cam_Center_POS select 1) + (MBG_WOO_CamDist)*cos _dir),MBG_WOO_CamHeight];
 {((findDisplay 5990) displayCtrl _x) ctrlEnable FALSE} foreach [101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130];


sleep 0.1;
showCinemaBorder false;

MBG_WOO_Main_cam = "camera" CamCreate MBG_WOO_Main_cam_View_POS;
MBG_WOO_Main_cam CameraEffect ["INTERNAL","Back"];
MBG_WOO_Main_cam CamSetTarget MBG_WOO_Main_cam_Center_POS;
MBG_WOO_Main_cam CamCommit 0.1;

call MBG_WOO_FUNC_EmptyPanelMenu;
call MBG_WOO_SHOW_OVERVIEWMAP;

while {dialog} do {
	sleep 0.8;
};

player cameraEffect ["terminate","back"];
camDestroy MBG_WOO_Main_cam;